package com.example.demo1.Demo2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class PeopleController3 {
    private PeopleService peopleService;
    //Setter方法注入

    @Autowired
    public void setPeopleService(PeopleService peopleService) {
        this.peopleService = peopleService;
    }

    public void sayhi(){
        peopleService.sayhi();
    }
}
